<?php 
/**
 * TomatoCMS
 * 
 * LICENSE
 *
 * This source file is subject to the GNU GENERAL PUBLIC LICENSE Version 2 
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://www.gnu.org/licenses/gpl-2.0.txt
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@tomatocms.com so we can send you a copy immediately.
 * 
 * @copyright	Copyright (c) 2009-2010 TIG Corporation (http://www.tig.vn)
 * @license		http://www.gnu.org/licenses/gpl-2.0.txt GNU GENERAL PUBLIC LICENSE Version 2
 * @version 	$Id: edit.phtml 4701 2010-08-16 16:31:45Z jam-gate.vn $
 * @since		2.0.0
 */
?>
<?php 
$this->headTitle($this->translator('shop_edit_page_title'));

$this->headScript()
	->appendFile($this->APP_STATIC_SERVER . '/js/jquery.validate/jquery.validate.min.js')
	->appendFile($this->APP_STATIC_SERVER . '/js/tomato/util.js');
?>

<div class="grid_12 t_a_ui_breadcrumb">
	<span><a href="<?php echo $this->url(array(), 'shop_shop_list'); ?>"><?php echo $this->translator('shop_list_breadcrumb'); ?></a></span>
	<span><?php echo $this->translator('shop_edit_breadcrumb'); ?></span>	
</div>

<div class="grid_12"><?php echo $this->flashMessenger(); ?></div>

<form method="post" action="<?php //echo $this->url(array('shop_id' => $this->shop->shop_id), 'shop_shop_edit'); ?>" id="editShopForm">
<div class="grid_12 t_a_bottom"><?php echo $this->translator('shop_add_guide'); ?></div>

<div class="grid_12 t_a_bottom">
	<div class="prefix_1 suffix_1">
		<div class="clearfix t_a_bottom">
			<label><?php echo $this->translator('shop_name'); ?>:</label>
			<input maxlength="255" type="text" id="name" name="name" value="<?php echo $this->shop->name; ?>" style="width: 300px" />
		</div>		
		<hr />
		<div class="clearfix t_a_bottom">
			<label>&nbsp;</label>
			<button type="submit"><span><?php echo $this->translator('shop_add_save_button'); ?></span></button>
		</div>
	</div>
</div>
</form>
<script type="text/javascript">
$(document).ready(function() {
	/**
	 * Validate form
	 */
	$('#editShopForm').validate({
		rules: {
			name: {
				required: true,
		  		maxlength: 255
			}
	    },
	    messages: {
	    	name: {
	        	required: "<?php echo $this->translator('shop_name_required'); ?>",
				maxlength: "<?php echo $this->translator('shop_name_maxlength'); ?>"
			}
		}
	});
});
</script>